package com.test.lifeCycle.util;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @ClassName MyInstantiationAwareBeanPostProcessor
 * @Description
 * @Author lihaiyang
 * @Date 2022/7/17 16:42
 * @Version 1.0
 */
@Component
public class MyInstantiationAwareBeanPostProcessor implements InstantiationAwareBeanPostProcessor {

	@Override
	public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException {
		if (beanName.equals("d")) {
			return false;
		}
		return true;
	}
}
